<?php

if (!defined('BUNDLE_DIR')) {
    define(BUNDLE_DIR, PROJECT_DIR . '/bundle');
}

class Adept_Locator_Bundle extends Adept_Locator
{
    
    const LOCALE_PARAM = 'locale';    

    public function __construct($locations = array())
    {
    	parent::__construct($locations);
    	$this->addLocation(BUNDLE_DIR);
    }
    
    public function locate($alias, $params = array())
    {
        $result = false;
        $locale = isset($params[self::LOCALE_PARAM]) ? $params[self::LOCALE_PARAM] : null;
        if ($locale != null) {
            $result = parent::locate($alias . '.'. $locale . '.ini');
        }
        if (!$result) {
            $result = parent::locate($alias . '.ini');
        }
        return $result;
    }
    
    public function unresolvedAlias($alias) 
    {
    	
    }	

}